-- GENERATED SPELL FOR [Bloodsail Warlock] --


function spell0_1564(pUnit, Event) --@Curse of Weakness,n/a--
pUnit:FullCastSpellOnTarget(11980,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1564', 552, 1)
end

function spell1_1564(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(20825,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_1564', 3000, 1)
end

function spell2_1564(pUnit, Event) --@Summon Imp,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(11939,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_1564', 1, 1)
end

function spell3_1564(pUnit, Event) --@Summon Succubus,Self--
pUnit:FullCastSpellOnTarget(8722,pUnit)
pUnit:RegisterEvent('Sorts_1564', 565, 1)
end

function Sorts_1564(pUnit, Event)
local choix_sorts_1564 = math.random(0, 3)
if choix_sorts_1564 == 0 then
pUnit:RegisterEvent('spell0_1564', 1, 1)
end
if choix_sorts_1564 == 1 then
pUnit:RegisterEvent('spell1_1564', 1, 1)
end
if choix_sorts_1564 == 2 then
pUnit:RegisterEvent('spell2_1564', 1, 1)
end
if choix_sorts_1564 == 3 then
pUnit:RegisterEvent('spell3_1564', 1, 1)
end
end

function mob1564_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_1564', math.random(1500, 3000), 1)
end

function mob1564_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1564_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob1564_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(1564, 1, 'mob1564_Action')
RegisterUnitEvent(1564, 2, 'mob1564_Leave')
RegisterUnitEvent(1564, 3, 'mob1564_Kill')
RegisterUnitEvent(1564, 4, 'mob1564_Die')
